<?php


namespace Xiaoguai\DesignPattern\DP021\State;


use Xiaoguai\DesignPattern\DP021\Context;
use Xiaoguai\DesignPattern\DP021\StateInterface;

class StateB implements StateInterface
{

    public function handle(Context $context)
    {
        // do something
        echo __CLASS__ . '::' . __METHOD__;

        // 转换状态
        $context->setState(new StateA());
    }
}